<template>
    <div class="Box">
        <div class="imgBox">
            <img :src="props.upic" @click="go"/>
        </div>
        <div class="infoBox">
            <div>
                <span>{{ props.uname }}</span>
                <span class="level">LV{{ props.level }}</span>    
            </div>
            <div class="detailInfoBox">
                <span>{{ formatNum(props.fans) }}粉丝</span>
                <span>·</span>
                <span>{{ formatNum(props.videos) }}个视频</span>
                <template v-if="props.official_verify.desc">
                    <span>{{ props.official_verify.desc }}</span>
                </template>
                <template v-else>
                    <span>{{ props.usign }}</span>
                </template>
            </div>
            <div>
                <el-button v-if="false" disabled style="width:100%;height:100%">已关注</el-button>
                <el-button v-else type="primary" style="width:100%;height:100%">+ 关注</el-button>
            </div>
        </div>
    </div> 
</template>

<script lang="ts" setup>
import { formatNum } from '@/utils/format'
interface Props{
    uname:string
    upic:string
    usign:string        //简介
    official_verify:{  //官方认证
        type:number
        desc:string
    }
    mid:number
    videos:number       //视频量
    fans:number         //粉丝量  
    level:number        //等级
}
const props = defineProps<Props>()

function goAuthor(){

}
function go(){

}
</script>

<style lang="scss" scoped>
@import url(../../../assets/css/publicNodeStyle.scss);
p{
    padding: 0;
    margin: 0;
}
.Box{
    display: flex;
    justify-content: start;
    align-items: center;
    height: 100%;
    width: 100%;
}
.imgBox{
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 100px;
    margin-right: 15px;
    height: 100%;
    & img:nth-child(1){
        object-fit: cover;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        cursor: pointer;
    }
}
.infoBox{
    width: 80%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: start;
    & div:nth-child(1){
        display: flex;
        justify-content: start;
        align-items: center;
        text-align: left;
        width: 100%;
        font-size: 18px;
        color: #18191C;
        font-weight: 600;
        
    }
    & div:nth-child(1) span:nth-child(1){
        cursor: pointer;
    }
    & div:nth-child(1) span:nth-child(1):hover{
        color:#409EFF;
    }
    & div:nth-child(3){
        width: 100px;
    }
}
.detailInfoBox{
    display: flex;
    justify-content: start;
    font-size: 14px;
    line-height: 18px;
    gap: 5px;
    width: 100%;
    color: #61666D;
    & span{
        white-space: nowrap;
    }
    & span:last-child{
        max-width: 50%;
        @include noWrap;
    }
}
</style>